package cn.water.rocketmq.consumer;

import cn.water.rocketmq.param.User;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "user-topic1",consumerGroup = "user-group",selectorExpression = "*")
public class MyConsumer2 implements RocketMQListener<User> {
    @Override
    public void onMessage(User user) {
        //处理消息
        System.out.println("username:"+user.getUsername());
        System.out.println("password:"+user.getPassword());
    }
}
